package cloud.dandanit.itservice.controller.rate;


import cloud.dandanit.itservice.entity.Rate;
import cloud.dandanit.itservice.service.RateService;
import cloud.dandanit.itservice.utils.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 会员表 前端控制器
 * </p>
 *
 * @author luokai
 * @since 2022-07-02
 */
@Api("评分")
@RestController
@RequestMapping("/itservice/rate")
public class RateController {

    @Autowired
    private RateService rateService;


    /**
     * 提交评分到redis中
     * @param rate 评分
     * @return 成功
     */
    @ApiOperation(value = "提交评分")
    @GetMapping("submitRateToRedis/{rate}")
    public R submitRateToRedis(
            @ApiParam(name = "rate", value = "评分", required = true)
            @PathVariable String rate) {

        rateService.submitRateToRedis(rate);
        return R.ok();
    }

}

